package com.kinghood.gateway.feign;


import com.kinghood.gateway.feign.fallback.AuthRemoteFallback;
import com.kinghood.gateway.feign.model.KingHoodResponseVO;
import com.kinghood.gateway.feign.model.ServerNameConstant;
import com.kinghood.gateway.feign.model.authority.GetUserReqDTO;
import com.kinghood.gateway.feign.model.authority.UserResDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import reactor.core.publisher.Mono;

/**
 * description
 *
 * @author zhangFanJun
 * @date 2023-12-07 9:47
 **/
@FeignClient(name = ServerNameConstant.AUTHORITY_CENTER, path = "/authorityCenter/auth", fallback = AuthRemoteFallback.class)
public interface AuthRemote {

    /**
     * 获取用户信息和权限
     *
     * @param in token
     * @return 用户信息
     * @author zfj
     * @date 2024/1/19
     */
    @PostMapping("/getUser")
    KingHoodResponseVO<UserResDTO> getUser(@RequestBody GetUserReqDTO in);

    /**
     * 获取用户信息和权限
     *
     * @param in token
     * @return 用户信息
     * @author zfj
     * @date 2024/1/19
     */
    @PostMapping("/getUserMono")
    Mono<KingHoodResponseVO<UserResDTO>> getUserMono(@RequestBody GetUserReqDTO in);

}
